# vim:set noet ts=4:
#
# scim-python
#
# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
#
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA  02111-1307  USA
#
# $Id: $
#
if ENABLE_PINYIN
pinyin_PYTHON =	\
	PinYin.py	\
	PYUtil.py	\
	PYParser.py	\
	PYSQLiteDB.py	\
	PYCreatePinYinDB.py	\
	SpecialTable.py	\
	ZhengJu.py 	\
	ShuangPin.py 	\
	JianPin.py 	\
	QuanPin.py 	\
	PYDict.py\
	ZhengJuDB.py	\
	__init__.py	\
	$(NULL)

pinyindir = $(pkgdatadir)/engine/PinYin

# PYDATA_FILES =	\
# 	utf8py.org	\
# 	utf8pyPhrase.org	\
# 	CharFreq-Modern_utf8.txt	\
# 	SogouLabDic-utf8.dic	\
# 	$(NULL)

PYDATA_FILES = 	\
	$(NULL)

pydb_DATA = py.db
pydbdir = $(pkgdatadir)/engine/PinYin
DBVER = 0.1.10.5
py.db:
	wget http://scim-python.googlecode.com/files/pinyin-database-${DBVER}.tar.bz2
	tar jxvf pinyin-database-${DBVER}.tar.bz2
#	$(PYTHON) $(srcdir)/PYCreatePinYinDB.py $(srcdir)

pyspecial_DATA = special_table
pyspecialdir = $(pkgdatadir)/engine/PinYin

EXTRA_DIST = $(PYDATA_FILES) special_table
DISTCLEANFILES = \
	py.db	\
	*.pyc	\
	pinyin-database-${DBVER}.tar.bz2 \
	$(NULL)

install-data-hook:
	@(if test "${NO_INDEX}" = ""; then \
		cd $(DESTDIR)$(pinyindir); \
		echo "Creating INDEX"; \
		$(PYTHON) -c "import PYSQLiteDB; db = PYSQLiteDB.PYSQLiteDB (filename='py.db'); db.create_indexes ();" ;\
	fi)
endif
uninstall-hook:

